package com.reviewit.model;

import java.io.Serializable;
import java.util.Date;

import org.bson.types.ObjectId;

import com.google.code.morphia.annotations.Entity;
import com.google.code.morphia.annotations.Id;

@Entity("anexo")
public class Anexo implements Serializable {
	
	private static final long serialVersionUID = 1L;

	@Id
	private ObjectId id;
	
	private ObjectId idDocument;
	private String name;
	private byte[] file;
	
	
	public Anexo() {
	}
	
	public Anexo(ObjectId id) {
		super();
		this.id = id;
	}

	public Anexo(ObjectId id, ObjectId idDocument, String name, Date creationDate, byte[] file) {
		super();
		this.id = id;
		this.name = name;
		this.idDocument = idDocument;
		this.file = file;
	}

	public ObjectId getId() {
		return id;
	}

	public void setId(ObjectId id) {
		this.id = id;
	}

	public ObjectId getIdDocument() {
		return idDocument;
	}

	public void setIdDocument(ObjectId idDocument) {
		this.idDocument = idDocument;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public byte[] getFile() {
		return file;
	}

	public void setFile(byte[] file) {
		this.file = file;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Anexo other = (Anexo) obj;
		if (id != other.id)
			return false;
		return true;
	}
	
}